# -*- coding:utf-8 -*-
'''
@File    :   login_demo_api.py
@Time    :   2024/11/17 10:55:32
@Author  :   xiangyu Chen
@Version :   1.0
@Contact :   yu112yu@sina.com
@License :   (C)Copyright 2017-2018, Liugroup-NLPR-CASIA
@Desc    :   None
'''

import requests


# 实现登录接口 ，暂时不考虑封装
def login(username, password, tcacheout=None):
    login_path = 'http://localhost:8080/admin/auth/login'
    login_data = {"username": username, "password": password, 'tcacheout': tcacheout}
    # response = requests.post(login_path, json=login_data)  # 实现登录

    response = requests.request("POST", login_path, json=login_data)
    # result = response.json()  # 返回的请求体数据以json显示
    return response


# print(login('1', '2').status_code)
